//
//  ViewController.m
//  26-HomeWork
//
//  Created by GivenBmli on 16/8/18.
//  Copyright © 2016年 GivenBmli. All rights reserved.
//

#import "ViewController.h"
#import "AppDelegate.h"
#import "Masonry.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self BKImageViewImage];
    [self btnButton];
    [self textTitleName];
    [self bmlView];
    [self bmlSlider];
    
 

}

- (void)BKImageViewImage {
    UIImageView *BKImageView = [[UIImageView alloc]initWithFrame:[UIScreen mainScreen].bounds];
    BKImageView.image = [UIImage imageNamed:@"welcome_2.jpg"];
    [self.view addSubview:BKImageView];
    UIImageView *RoundImage = [[UIImageView alloc] initWithFrame:[UIScreen mainScreen].bounds];
    
    RoundImage.image = [UIImage imageNamed:@"JL"];
    [BKImageView addSubview:RoundImage];
    [RoundImage mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(60);
        make.top.mas_equalTo(160);
        make.width.mas_equalTo(300);
        make.height.mas_equalTo(300);
    
        
                RoundImage.layer.masksToBounds = YES;
                RoundImage.layer.cornerRadius = self.view.frame.size.width / 3;
    }];
    
    
}
- (void)btnButton {
    UIButton *btn = [UIButton new];
    [btn setImage:[UIImage imageNamed:@"baibiao"] forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(Choose:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn];
    [btn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(20);
        make.left.mas_equalTo(30);
        make.width.mas_equalTo(30);
        make.height.mas_equalTo(30);
    }];
    UIButton *btn1 =[UIButton new];
    [btn1 setImage:[UIImage imageNamed:@"baidian"] forState:UIControlStateNormal];
    [btn1 addTarget:self action:@selector(More:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn1];
    [btn1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(370);
        make.top.mas_equalTo(30);
        make.width.mas_equalTo(30);
        make.height.mas_equalTo(30);
    }];
    
    UIButton *btn2 =[UIButton new];
    [btn2 setImage:[UIImage imageNamed:@"normal"] forState:UIControlStateNormal];
    [btn2 addTarget:self action:@selector(kind:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn2];
    [btn2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(60);
        make.top.mas_equalTo(100);
        make.width.mas_equalTo(60);
        make.height.mas_equalTo(30);
    }];
    
    UIButton *btn3 =[UIButton new];
    [btn3 setImage:[UIImage imageNamed:@"personal"] forState:UIControlStateNormal];
    [btn3 addTarget:self action:@selector(personal:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn3];
    [btn3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(135);
        make.top.mas_equalTo(100);
        make.width.mas_equalTo(60);
        make.height.mas_equalTo(30);
    }];
    
    UIButton *btn4 =[UIButton new];
    [btn4 setImage:[UIImage imageNamed:@"MV"] forState:UIControlStateNormal];
    [btn4 addTarget:self action:@selector(MV:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn4];
    [btn4 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(215);
        make.top.mas_equalTo(100);
        make.width.mas_equalTo(60);
        make.height.mas_equalTo(30);
    }];
    
    UIButton *btn5 =[UIButton new];
    [btn5 setImage:[UIImage imageNamed:@"dts"] forState:UIControlStateNormal];
    [btn5 addTarget:self action:@selector(dts:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn5];
    [btn5 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(290);
        make.top.mas_equalTo(100);
        make.width.mas_equalTo(60);
        make.height.mas_equalTo(30);
        
    }];
    UIButton *btn6 =[UIButton new];
    [btn6 setImage:[UIImage imageNamed:@"play"] forState:UIControlStateNormal];
    [btn6 addTarget:self action:@selector(Play:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn6];
    [btn6 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(160);
        make.top.mas_equalTo(580);
        make.width.mas_equalTo(80);
        make.height.mas_equalTo(80);
    }];
    
    UIButton *btn7 = [ UIButton new];
    [btn7 setImage:[UIImage imageNamed:@"before.png"] forState:UIControlStateNormal];
    [btn7 addTarget:self action:@selector(before:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn7];
    [btn7 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(50);
        make.top.mas_equalTo(570);
        make.width.mas_equalTo(90);
        make.height.mas_equalTo(90);
    }];
    
    UIButton *btn8 = [UIButton new];
    [btn8 setImage:[UIImage imageNamed:@"next.png"] forState:UIControlStateNormal];
    [btn8 addTarget:self action:@selector(next:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn8];
    [btn8 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(270);
        make.top.mas_equalTo(580);
        make.width.mas_equalTo(80);
        make.height.mas_equalTo(80);
    }];
    
    UIButton *btn9 = [UIButton new];
    [btn9 setImage:[UIImage imageNamed:@"love.png"] forState:UIControlStateNormal];
    [btn9 addTarget:self action:@selector(love:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn9];
    [btn9 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.top.mas_equalTo(650);
        make.width.mas_equalTo(50);
        make.height.mas_equalTo(50);
    }];
    
    UIButton *btn10 = [UIButton new];
    [btn10 setImage:[UIImage imageNamed:@"循环.png"] forState:UIControlStateNormal];
    [btn10 addTarget:self action:@selector(turn:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn10];
    [btn10 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(100);
        make.top.mas_equalTo(650);
        make.width.mas_equalTo(50);
        make.height.mas_equalTo(50);
    }];
    
    UIButton *btn11 = [UIButton new];
    [btn11 setImage:[UIImage imageNamed:@"下载.png"] forState:UIControlStateNormal];
    [btn11 addTarget:self action:@selector(download:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn11];
    [btn11 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(170);
        make.top.mas_equalTo(650);
        make.width.mas_equalTo(50);
        make.height.mas_equalTo(50);
    }];
    
    
    UIButton *btn12 = [UIButton new];
    [btn12 setImage:[UIImage imageNamed:@"share.png"] forState:UIControlStateNormal];
    [btn12 addTarget:self action:@selector(share:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn12];
    [btn12 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(255);
        make.top.mas_equalTo(650);
        make.width.mas_equalTo(50);
        make.height.mas_equalTo(50);
    }];
    
    UIButton *btn13 = [UIButton new];
    [btn13 setImage:[UIImage imageNamed:@"songlist.png"] forState:UIControlStateNormal];
    [btn13 addTarget:self action:@selector(songlist:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn13];
    [btn13 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(335);
        make.top.mas_equalTo(650);
        make.width.mas_equalTo(50);
        make.height.mas_equalTo(50);
    }];

    
}
- (void)textTitleName {
    UITextField *songName  =[UITextField new];
    [songName setText:@"稻香"];
    [songName setTextColor:[UIColor whiteColor]];
    [self.view addSubview:songName];
    [songName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(30);
        make.left.mas_equalTo(180);
        make.width.mas_equalTo(60);
        make.height.mas_equalTo(30);
    }];
    
    UITextField *songer = [UITextField new] ;
    [songer setText:@"周杰伦"];
    [songer setTextColor:[UIColor whiteColor]];
    [self.view addSubview:songer];
    [songer mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(180);
        make.top.mas_equalTo(70);
        make.width.mas_equalTo(90);
        make.height.mas_equalTo(30);
    }];
    
    UITextField *ss = [UITextField new] ;
    [ss setText:@"稻香 -- 周杰伦"];
    [ss setTextColor:[UIColor whiteColor]];
    [self.view addSubview:ss];
    [ss mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(150);
        make.top.mas_equalTo(500);
        make.width.mas_equalTo(150);
        make.height.mas_equalTo(30);
        
    }];

}
- (void)bmlView {
    UIView *view1 = [UIView new];
    view1.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:view1];
    [view1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(120);
        make.top.mas_equalTo(83);
        make.width.mas_equalTo(40);
        make.height.mas_equalTo(2);
    }];
    
    
    
    UIView *view2 = [UIView new];
    view2.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:view2];
    [view2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(250);
        make.top.mas_equalTo(83);
        make.width.mas_equalTo(40);
        make.height.mas_equalTo(2);
    }];
}
- (void)bmlSlider {
    UISlider *slider = [UISlider new];
    slider.minimumTrackTintColor = [UIColor greenColor];
    slider.minimumValue = 0.0f;
    slider.maximumValue = 1.0f;
    [slider addTarget:self action:@selector(sliderAction:) forControlEvents:UIControlEventValueChanged];
    [self.view addSubview:slider];
    [slider mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(50);
        make.top.mas_equalTo(550);
        make.width.mas_equalTo(290);
        make.height.mas_equalTo(30);
        
    }];
    
}

- (void)sliderAction:(UISlider *)sliderControl{
    NSLog(@"%f", sliderControl.value);
}
- (void)Choose:(UIButton *)btn {
    NSLog(@"菜单");
}
- (void)More:(UIButton *)btn1 {
    NSLog(@"更多");
}
- (void)kind:(UIButton *)btn2 {
    NSLog(@"品质");
}
- (void)personal:(UIButton *)btn3 {
    NSLog(@"独家");
}
- (void)MV:(UIButton *)btn4 {
    NSLog(@"观看MV");
}
- (void)dts:(UIButton *)btn5 {
    NSLog(@"dts");
}
- (void)Play:(UIButton *)btn6 {
    NSLog(@"播放");
}
- (void)before:(UIButton *)btn7 {
    NSLog(@"上一首");
}
- (void)next:(UIButton *)btn8 {
    NSLog(@"下一首");
}
- (void)love:(UIButton *)btn9 {
    NSLog(@"收藏");
}
- (void)turn:(UIButton *)btn10 {
    NSLog(@"播放顺序");
}
- (void)download:(UIButton *)btn11 {
    NSLog(@"下载");
}
- (void)share:(UIButton *)btn12 {
    NSLog(@"分享");
}
- (void)songlist:(UIButton *)btn13 {
    NSLog(@"播放列表");
}

@end
